package com.cs.study.homework._0302;

import java.io.File;

import java.util.Arrays;

public class Demo {
    public static void main(String[] args) {
        File file = new File("E:\\a");
        File[] files = file.listFiles(pathname -> {
                    if (pathname.isDirectory()) {
                        return pathname.getName().contains("a");
                    }
                    if (pathname.isFile()) {
                        return pathname.getName().startsWith("a");
                    }
                    return pathname.getName().endsWith(".txt");
                }
        );
        System.out.println(Arrays.toString(files));

    }
}
